package com.ssm.lzh.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.lzh.service.JbkService;
import com.ssm.pojo.Jbk;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/lzh")
public class JbkController {


        @Resource
        private JbkService jbkService;

        @RequestMapping("/queryAllJbk")
        @ResponseBody
        public PageInfo<Jbk> queryAllJbk(@RequestBody Page<Jbk> page){
            return this.jbkService.queryAllJbk(page);
        }

        @RequestMapping("/addJbk")
        @ResponseBody
        public int addJb(@RequestBody Jbk jbk){
                return this.jbkService.addJb(jbk);
        }

        @RequestMapping("/UpdateJb")
        @ResponseBody
        public int updateJb(@RequestBody Jbk jbk){
                return this.jbkService.updateJb(jbk);
        }

        @RequestMapping("/deleteJb")
        @ResponseBody
        public int deleteJb(String id){
                return this.jbkService.deleteJb(id);
        }
}
